<!--
 * @Author: Leng
 * @Date: 2021-01-31 20:15:37
 * @Description: 
 * @FilePath: \vue-leng\src\noUse\home\Home.vue
-->
<template>
  <div class="home">

  </div>
</template>

<script>
  //引入请求
  // import {getGroupDeviceList,changeUrl} from '@/network/home'

  export default {
    name: 'home',
    data() {
      return {
      }
    },
    components:{
    },
    created() {
    },
    mounted() {
    },
    methods: {
      // $emit
      getzi(msg){
        console.log(msg);
      },
      //$refs
      gettest1(){
        console.log(this.$refs.test1.msg);
        //吸顶效果(获取距顶部距离),等待加载完毕后去执行,不然距顶部距离不准确
        console.log("距顶部："+this.$refs.test1.$el.offsetTop);
      },
     //传参请求
     getGroupDeviceList(){
       getGroupDeviceList('1038604707083456512').then(res=>{
         console.log(res);
     })
     },
     //改变请求地址
     changeUrl(){
       changeUrl('JG001').then(res=>{
         console.log(res);
       })
     },
     //跳转到select
     tosel(){
       this.$router.push({
         path:'goselect',
         query:{
           id:1,
           name:'这是1'
         }

       })
     }
    },
    computed: {

    },
    watch: {

    }
  }
</script>

<style lang="scss" scoped>
  h1 {
    text-align: center;
  }
  .other{
    width: 100%;
    color: #fff;
    background-color: orchid;
    text-align: center;
    margin-top: 20px;
  }
  .oNext{
    margin: 10px;
    padding: 10px 15px;
    color: #fff;
    background-color: skyblue;
    border-radius: 10px;
    float: left;
    display: inline-block;
    cursor: pointer;
  }
</style>
